package po;

import com.test.aware.BeanFactoryAware;
import com.test.aware.BeanNameAware;
import com.test.factory.AbstractBeanFactory;
import com.test.factory.BeanFactory;

public class AwareBean implements BeanNameAware, BeanFactoryAware{

    private String beanName;
    private BeanFactory beanFactory;
    @Override
    public void setBeanFactory(AbstractBeanFactory beanFactory) {
        System.out.println("awareBean的setBeanFactory方法: " + beanFactory);
        this.beanFactory = beanFactory;
    }

    @Override
    public void setBeanName(String name) {
        System.out.println("awareBean的setBeanName方法: " + name);
        this.beanName = name;
    }

    public String getBeanName() {
        return beanName;
    }
    public BeanFactory getBeanFactory() {
        return beanFactory;
    }
}
